package com.morningstar.flow.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.morningstar.common.arco.ISelectOption;
import com.morningstar.common.dao.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 流程组
 */
@Setter
@Getter
@TableName("flow_process_group")
public class FlowProcessGroup extends BaseEntity implements ISelectOption {
    /**
     * 流程组Id
     */
    @TableId(value = "process_group_id", type = IdType.ASSIGN_ID)
    private Long processGroupId;

    /**
     * 流程组名称
     */
    @TableField("process_group_name")
    private String processGroupName;
    /**
     * 排序
     */
    @TableField("sort")
    private Integer sort;

    /**
     * 流程组下的流程信息
     */
    @TableField(exist = false)
    private List<FlowProcess> processes;

    @Override
    public String getLabel() {
        return processGroupName;
    }

    @Override
    public Long getValue() {
        return processGroupId;
    }
}
